package com.mybatis;

import com.mybatis.entity.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;
import java.util.List;

public class Test03 {
    public static void main(String[] args) {
        //加载spring配置文件
        ApplicationContext ac =
                new ClassPathXmlApplicationContext("spring-mybatis.xml");

        UserServiceI usi = (UserServiceI)ac.getBean("userServiceI");
        User user = new User();
        user.setUserName("天天向上");
        user.setId(1);
        //String result = usi.editUser(user);

        //String result = usi.removeUser(4);
        List<Integer> list = new ArrayList<Integer>();
        list.add(1);list.add(2);list.add(3);
        String result = usi.batchRemoveUser(list);
        System.out.println(result);


    }
}
